<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@ include file="/page/include.jsp"%>
<link rel="stylesheet" type="text/css" href="${rootPath }/statics/css/style.css" />
<script type="text/javascript" src="${rootPath }/statics/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${rootPath }/statics/jslib/upload/ajaxfileupload.js"></script>
<script>
//通过ajax提交图片
function ajaxFileUpload() {
	jQuery.ajaxFileUpload({
		url: rootPath + '/uploadFile/uploadOneFile.do',
		secureuri: false,
		fileElementId: 'uploadFile',
		dataType: 'json',
		success: function(data, status) {
			if(data.code == 1) {
				var li = "<li><div class=\"pic1\"><img src=\"" + imgRootURL + data.filePath + "\" />" 
				       + "<a href=\"javascript:void(0)\" class=\"icon_close\"></a></div></li>";
				$("ul").append(li);
			} else {
				
			}
		},
		error: function(data, status, e) {
			var li = "<li><div class=\"pic1\"><img src=\"" + imgRootURL + data.filePath + "\" />" 
		       + "<a href=\"javascript:void(0)\" class=\"icon_close\"></a></div></li>";
			$("ul").append(li);
		}
	});
}
</script>
</head>
<body>
<div class="prd_form1">
<dl>
	<dt>
		<div class="txt1">
			<div class="uploadpic_part">
				<ul>
					<li>
						<div class="pic1">
							<img src="<%=basePath %>/statics/images/upload_pic1.png" /> 
							<input id="uploadFile" name="uploadFile" type="file" onchange="ajaxFileUpload()" />
						</div>
					</li>
					<li>
						<div class="pic1">
							<img src="<%=basePath %>/statics/images/product_pic2.png" /> 
							<a href="#" class="icon_close"></a>
						</div>
					</li>
				</ul>
			</div>
			<span class="pictips">建议尺寸：800*800PX，单张大小不超过1M</span>
		</div>
	</dt>
</dl>
</div>
</body>
</html>